﻿#if UNITY_ANDROID
using System;
using UnityEngine;

namespace Notifications.Runtime.Android
{
    public class AndroidBackgroundNotification : AndroidJavaProxy,IGameBackgroundNotification
    {
        private bool _needClose = false;
        private int _progress = -1;
        private bool _showProgress = false;
        public AndroidBackgroundNotification() : base(AndroidBackgroundNotificationManager.PACKAGE_BACKGROUND_NAME)
        {
            _needClose = false;
        }

        public void SetNeedClose(bool b)
        {
            _needClose = b;
        }
        
        public void SetId(int id)
        {
            Id = id;
        }
        
        public void SetTitle(string title)
        {
            Title = title;
        }
        
        public void SetContent(string content)
        {
            Body = content;
        }  
        
        public void SetProgress(int progress)
        {
            _progress = progress;
        }

        public void SetNeedShowProgress(bool show)
        {
            _showProgress = show;
        }

        public IGameNotification InterGameNotification { get; set; }

        public int GetId()
        {
            return Id.GetValueOrDefault();
        }

        public string GetTitle()
        {
            return Title;
        }

        public string GetContent()
        {
            return Body;
        }

        public int GetAppSmallIcon()
        {
            return -1;
        }

        public bool NeedClose()
        {
            return _needClose;
        }

        public int GetReturnAction()
        {
            return 0;
        }

        public int GetProgress()
        {
            return _progress;
        }

        public bool NeedShowProgress()
        {
            return _progress >=0 && _progress<= 100;
        }

        public int? Id { get; set; }
        public string Title { get; set; }
        public string Body { get; set; }
        public string Subtitle { get; set; }
        public string Data { get; set; }
        public string Group { get; set; }
        public int? BadgeNumber { get; set; }
        public bool ShouldAutoCancel { get; set; }
        public DateTime? DeliveryTime { get; set; }
        public bool Scheduled { get; }
        public string SmallIcon { get; set; }
    }
}
#endif